<%@ page language="java" import="java.util.*,com.service.*,com.entity.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'CheckNew.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<%@ taglib prefix="s" uri="/struts-tags" %>
  </head>
  
  <body>
   <% 
   int lid=Integer.parseInt(request.getParameter("lid").toString());
   request.getSession().setAttribute("lid",lid);
   
   ArrayList<News> list=(ArrayList<News>) request.getAttribute("news");%>
  <center>
  <table border=1 cellspacing="0">
  <tr><td>新闻id</td><td>新闻标题</td><td>新闻内容</td><td>新闻发布时间</td><td>新闻来源</td><td>操作</td></tr>
  <% 	
  		
  	
 
 	 	for(News u:list)
 	 	{
 	 		out.print("<tr><td>"+u.getNid()+"</td>");
 	 		out.print("<td>"+u.getNtitle()+"</td>");
 	 		out.print("<td>"+u.getNcontext()+"</td>");
 	 		out.print("<td>"+u.getNtime()+"</td>");
 	 		out.print("<td>"+u.getNsource()+"</td>");
 %>
 			<s:url id="url1" action="/changeNew1">
             	 <s:param name="nid"><%=u.getNid() %></s:param>
			</s:url>
			<td><s:a href='%{url1}'>修改本条新闻</s:a>&nbsp
 <%
 	 		//out.print("<td><a href='/NManager/changeNew.jsp?nid="+u.getNid()+"'>修改本条新闻</a>&nbsp");
 	 		out.print("<a href='sb_delNew.action?nid="+u.getNid()+"' >删除本条新闻</a></td></tr>");
 		
 	 	}
 	 	 
 	  %>
 	
 	  </table>
 	  </center>
  </body>
</html>
